package com.lxw.multidb.controller.es;

import cn.hutool.core.date.DateTime;
import cn.tannn.jdevelops.result.bean.SerializableBean;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * CreateIndexDTO
 *
 * @author lxw
 * @version V1.0
 * @date 2025/10/30 16:59
 */
@Schema(description = "创建索引请求参数")
@ToString
@Getter
@Setter
public class CreateIndexDTO extends SerializableBean<CreateIndexDTO> {

    private Integer dbId;

    private String dbName;

    private String tableName;

    private String condition;

    private String sortField;

    private String indexName;

    private String rulePath;

    public String realIndexName() {
        String thisNow = DateTime.now().toString("yyyy");

        return tableName + "_" + thisNow;
    }

}
